import java.util.Scanner;

public class Main1154 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        for (int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
        }
        int dest1 = sc.nextInt();
        int head = 0;//初始的首索引
        int end = num.length-1 ;//初始的末索引
        boolean isFlag1 = false;
        while (head <= end) {

            int middle = (head + end) / 2;

            if (dest1 == num[middle]) {
                System.out.println(middle+1);
                isFlag1 = true;
                break;
            } else if (num[middle] > dest1) {
                end = middle - 1;
            } else {//num[middle] < dest1
                head = middle + 1;
            }
        }
        if (!isFlag1) {
            System.out.println("-1");
        }
    }
}
